<template>
  <div>
     <img src="./assets/1610711755(1).jpg" alt="" v-if="flag">
    <button @click="fn()">点击以后显示和隐藏</button>

   </div>
</template>
 
<script>
export default {

  data() {
    return {
      flag:true
    };
  },

  methods: {
    fn(){
      this.flag=!this.flag;
    }
  }
};
</script>

<style scoped>
     
</style>